#!/bin/bash
HERE=`pwd`
set -e
AGENT_BIN=${HERE}/agent_bin
rm -rf ${AGENT_BIN}
mkdir -p ${AGENT_BIN}

LIB_CLOWNIX=${HERE}/../lib_io_clownix
BLKD=${HERE}/../lib_blkd
RPCT=${HERE}/../lib_rpct

export CC=gcc
export AR=ar
export RANLIB=ranlib
export CFLAGS=""

cd $LIB_CLOWNIX
make clean
make

cd $BLKD
make clean
make

cd $RPCT
make clean
make

cd ${HERE}/cloonix_dropbear
make clean
make

cp scp      ${AGENT_BIN}/dropbear_cloonix_scp
cp dbclient ${AGENT_BIN}/dropbear_cloonix_ssh
cp dropbear ${AGENT_BIN}/dropbear_cloonix_sshd


